( w => { 

    let X = function( method , url , handler , params = null){
        let $http = new XMLHttpRequest();
        $http.addEventListener( 'readystatechange' , handler , false );
        $http.open( method , url );
        if( 'post' === method.toLowerCase() || 'put' === method.toLowerCase() ) {
            $http.setRequestHeader( 'content-type' , 'application/x-www-form-urlencoded' );
        }
        $http.send( params );
    }

    // 将局部变量 X 赋值到 window 对象的属性上
    w.async = X ;

})( window );